
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:cc="http://java.sun.com/jsf/composite"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:s="http://www.sensap.eu/jsf"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:pe="http://primefaces.org/ui/extensions">

<!-- INTERFACE -->
<cc:interface>
	<cc:attribute name="id" />
</cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>
	<p:dialog header="#{messages.UI_IMPORT_APPLICATIONS_DIALOG_HEADER}"
		modal="true" closable="false" closeOnEscape="true" resizable="false"
		widgetVar="#{cc.attrs.id}" width="500">
		<h:form id="importApplicationsDialogForm"
			enctype="multipart/form-data">

			<h:panelGrid columns="2" style="width:100%;box-sizing:border-box;"
				columnClasses="half-available-width">

				<p:outputPanel>
					<p:outputLabel for="applicationData"
						value="#{messages.UI_IMPORT_APPLICATIONS_DIALOG_DATA}" />
				</p:outputPanel>
				<p:outputPanel>
					<p:fileUpload id="applicationData" mode="simple"
						value="#{applicationDesignPageController.context.uploadedSpec}" />
				</p:outputPanel>

				<p:outputPanel>
					<p:outputLabel for="persistToServer"
						value="#{messages.UI_IMPORT_APPLICATIONS_DIALOG_PERSIST}" />
				</p:outputPanel>
				<p:outputPanel>
					<p:selectBooleanCheckbox id="persistToServer"
						value="#{applicationDesignPageController.context.persistSpec}" />
				</p:outputPanel>

			</h:panelGrid>

			<p:outputPanel layout="block" styleClass="ui-dialog-footer"
				style="text-align:right;">
				<p:separator />

				<p:commandButton value="#{messages.DIALOG_CONFIRM}" ajax="false"
					actionListener="#{applicationDesignPageController.importApplications()}"/>

				<p:button value="#{messages.DIALOG_CANCEL}"
					style="margin-left:10px;"
					onclick="#{cc.attrs.id}.hide();return false;" />
			</p:outputPanel>
		</h:form>
	</p:dialog>
</cc:implementation>
</html>
